#include<stdio.h>
int main()
{
    int arr[20][20]={0};
    int n;
    scanf("%d",&n);
    int hang = 0;
    int lie = n/2;
    arr[0][n/2] = 1;
    int num = 2;
    while(num<=n*n)
    {
        int hang1 = hang;
        int lie1 = lie;
        if(--hang<0)
        {
            hang = n-1;
        }
        if(++lie==n)
        {
            lie = 0;
        }
        if(arr[hang][lie]==0)
        {
            arr[hang][lie]=num;
        }
        else
        {
            hang = hang1+1;
            lie = lie1;
            arr[hang][lie]=num;
        }
        num++;
    }
    for(int i=0;i<n;i++)
    {
        printf(" ");
        for(int j = 0;j<n;j++)
        {
            printf("%4d",arr[i][j]);
            if(j!=n-1)
            {
                printf(" ");
            }
            if(j==n-1&&i!=n-1)
            {
                printf("\n");
            }
        }
    }
    return 0;
}